package com.javabi.common.lang;

public class Java {

	public static final long getCurrentTime() {
		return System.currentTimeMillis();
	}

	public static final int getCurrentTimeInSeconds() {
		return (int) (System.currentTimeMillis() / 1000);
	}

	public static long getMaximumMemory() {
		return Runtime.getRuntime().maxMemory();
	}

	public static long getCommittedMemory() {
		return Runtime.getRuntime().totalMemory();
	}

	public static long getFreeMemory() {
		return Runtime.getRuntime().freeMemory();
	}

	public static long getUsedMemory() {
		Runtime runtime = Runtime.getRuntime();
		return runtime.totalMemory() - runtime.freeMemory();
	}

	public static long getNanoTime() {
		return System.nanoTime();
	}

	private Java() {
	}
}
